function createStudent(sno,name,age,gender){
    var obj =new Object();
    obj.sno = sno;
    obj.name = name;
    obj.age = age;
    obj.gender = gender;
    obj.sayHi = function(){
        console.log('大家好，我叫'+this.name);
    }
    return obj;
}

var stu1 = createStudent('123456','张三',20,'男');
var stu2 = createStudent('123457','李四',21,'男');
stu1.sayHi();
stu2.sayHi();